package com.tiger.common.core.domain.entity;

import java.util.ArrayList;
import java.util.List;
import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.tiger.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.tiger.common.core.domain.BaseEntity;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 公司表 sys_dept
 *
 * @author tiger
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "sys_dept对象", description = "【公司管理】内容")
public class SysDept extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 公司ID
     */
    @ApiModelProperty(value = "ID")
    private Long deptId;

    /**
     * 父公司ID
     */
    @ApiModelProperty(value = "父公司id")
    private Long parentId;

    /**
     * 顶级公司ID
     */
    @ApiModelProperty(value = "顶级公司id")
    private Long superId;

    /**
     * 公司logo
     */
    @ApiModelProperty(value = "公司logo")
    private String logo;

    /**
     * 当前公司层级
     */
    @ApiModelProperty(value = "当前公司层级")
    private Integer level;

    /**
     * 祖级列表
     */
    @ApiModelProperty(value = "祖级列表")
    private String ancestors;

    /**
     * 公司全称
     */
    @ApiModelProperty(value = "公司全称")
    private String deptName;

    /**
     * 显示顺序
     */
    @ApiModelProperty(value = "排序")
    private Integer orderNum;

    /**
     * 负责人
     */
    @ApiModelProperty(value = "公司负责人姓名")
    private String leader;

    /**
     * 联系电话
     */
    @ApiModelProperty(value = "联系电话")
    private String phone;

    /**
     * 邮箱
     */
    private String email;

    /**
     * 公司状态:0正常,1停用
     */
    private String status;

    /**
     * 删除标志（0代表存在 2代表删除）
     */
    private String delFlag;

    /**
     * 父公司名称
     */
    private String parentName;


    @ApiModelProperty(value = "公司图片")
    private String companyPic;

    /**
     * 公司编码
     */
    @Excel(name = "公司编码")
    @ApiModelProperty(value = "公司编码")
    private String code;

    /**
     * 公司简称
     */
    @Excel(name = "公司简称")
    @ApiModelProperty(value = "公司简称")
    private String companyShortName;

    /**
     * 公司地址
     */
    @Excel(name = "公司地址")
    @ApiModelProperty(value = "公司地址")
    private String companyAddress;

    /**
     * 传真号码
     */
    @Excel(name = "传真号码")
    @ApiModelProperty(value = "传真号码")
    private String faxNumber;


    /**
     * 统一社会信用代码
     */
    @Excel(name = "统一社会信用代码")
    @ApiModelProperty(value = "统一社会信用代码")
    private String creditUnionCode;

    /**
     * 开户行名称
     */
    @Excel(name = "开户行名称")
    @ApiModelProperty(value = "开户行名称")
    private String openingBankName;

    /**
     * 银行账户
     */
    @Excel(name = "银行账户")
    @ApiModelProperty(value = "银行账户")
    private String bankAccount;

    /**
     * 公司介绍
     */
    @Excel(name = "公司介绍")
    @ApiModelProperty(value = "公司介绍")
    private String companyIntroduce;

    @ApiModelProperty(value = "是否为国融公司 0-否 1-是")
    private Long isCompany;

    /**
     * 子公司
     */
    private List<SysDept> children = new ArrayList<SysDept>();

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        this.deptId = deptId;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getAncestors() {
        return ancestors;
    }

    public void setAncestors(String ancestors) {
        this.ancestors = ancestors;
    }

    @NotBlank(message = "公司名称不能为空")
    @Size(min = 0, max = 30, message = "公司名称长度不能超过30个字符")
    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    @NotNull(message = "显示顺序不能为空")
    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public String getLeader() {
        return leader;
    }

    public void setLeader(String leader) {
        this.leader = leader;
    }

    @Size(min = 0, max = 11, message = "联系电话长度不能超过11个字符")
    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Email(message = "邮箱格式不正确")
    @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public List<SysDept> getChildren() {
        return children;
    }

    public void setChildren(List<SysDept> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("deptId", getDeptId())
                .append("parentId", getParentId())
                .append("ancestors", getAncestors())
                .append("deptName", getDeptName())
                .append("orderNum", getOrderNum())
                .append("leader", getLeader())
                .append("phone", getPhone())
                .append("email", getEmail())
                .append("status", getStatus())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
